package com.ruoyi.cust.service.impl;

import java.util.List;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cust.mapper.CityCarouselMapper;
import com.ruoyi.cust.domain.CityCarousel;
import com.ruoyi.cust.service.ICityCarouselService;

/**
 * 轮播Service业务层处理
 *
 * @author cjq
 * @date 2024-12-06
 */
@Service
public class CityCarouselServiceImpl implements ICityCarouselService {
    @Autowired
    private CityCarouselMapper cityCarouselMapper;

    /**
     * 查询轮播
     *
     * @param carouselId 轮播主键
     * @return 轮播
     */
    @Override
    public CityCarousel selectCityCarouselByCarouselId(Long carouselId) {
        return cityCarouselMapper.selectCityCarouselByCarouselId(carouselId);
    }

    /**
     * 查询轮播列表
     *
     * @param cityCarousel 轮播
     * @return 轮播
     */
    @Override
    public List<CityCarousel> selectCityCarouselList(CityCarousel cityCarousel) {
        return cityCarouselMapper.selectCityCarouselList(cityCarousel);
    }

    /**
     * 新增轮播
     *
     * @param cityCarousel 轮播
     * @return 结果
     */
    @Override
    public int insertCityCarousel(CityCarousel cityCarousel) {
                cityCarousel.setCreateTime(DateUtils.getNowDate());
            return cityCarouselMapper.insertCityCarousel(cityCarousel);
    }

    /**
     * 修改轮播
     *
     * @param cityCarousel 轮播
     * @return 结果
     */
    @Override
    public int updateCityCarousel(CityCarousel cityCarousel) {
        return cityCarouselMapper.updateCityCarousel(cityCarousel);
    }

    /**
     * 批量删除轮播
     *
     * @param carouselIds 需要删除的轮播主键
     * @return 结果
     */
    @Override
    public int deleteCityCarouselByCarouselIds(Long[] carouselIds) {
        return cityCarouselMapper.deleteCityCarouselByCarouselIds(carouselIds);
    }

    /**
     * 删除轮播信息
     *
     * @param carouselId 轮播主键
     * @return 结果
     */
    @Override
    public int deleteCityCarouselByCarouselId(Long carouselId) {
        return cityCarouselMapper.deleteCityCarouselByCarouselId(carouselId);
    }
}
